import Paging from '../../../wxjs/Paging.js'
var pag = new Paging();
var app = getApp()
Page(Object.assign(pag.func(), {
  data:{
    lists:[],
    form: {
      // userId: "466",
      form: "1",
      tV2CustomMatchScheduleId: 26,
      pageNum: "1",
      pageSize: "999"
    }
  },
  listParams: {
    // userId: "466",
    form: "1",
    tV2CustomMatchScheduleId: 26,
    pageNum: "1",
    pageSize: "999"
  },
  callBack(res, lists) {
    this.setData(this.handleList(res.data))
  },
  onLoad(options){
    if (!options.id) {
      wx.showToast({
        icon: 'none',
        title: '打卡赛id不能为空',
        duration: 5000
      })
      setTimeout(() => {
        wx.navigateBack({})
      }, 5000)
      return
    }
    // 处理参数
    var user = wx.getStorageSync('user')
    this.listParams.tV2CustomMatchScheduleId = options.id

    this.pageListInit();
  },
  reqUrl: app.serAddrs['getAwardDetail'],
  header: { 'content-type': 'application/x-www-form-urlencoded' },

  

  /**
   * 处理成我已经写好的格式
   * [{
   *    avator: './images/test.png',
   *    name: '傻逼',
   *    money: '￥19.00',
   *    index: '4'
   * }]
   */
  handleList(list) {
    return {
      lists: list.map((item,index) => {
        return {
          avator: item.headPortrait,
          name: item.username,
          money: item.orderTime,
          index: index + 1
        }
      })
    }
  }
}))